Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PER-9361-Email and phone verification are broken; #302

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

crisnicandrei
Copy link
Contributor

Changed the way isLoggedIn is handled in the verify component and made sure that keepLoggedIn is not being set to null after phone or mail verification.

Steps to test:

1.Log in or create a new account.
2. Verify your email.
3. Refresh.

The button should not appear a second time now.

Changed the way isLoggedIn is handled in the verify component and made sure that keepLoggedIn is not being set to null after phone or mail verification
Wrote tests to verify if the verifications are succesful.
Copy link
Member

@meisekimiu meisekimiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally these look good, I just have some notes about a small adjustment to the tests I'd like to see fixed. Thanks for fixing this bug!

instance.setAccount(account);

await instance.verifyEmail('sampleToken');
expect(instance.getAccount().emailStatus).toBe('status.auth.verified');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(instance.getAccount().emailStatus).toBe('status.auth.verified');
expect(instance.getAccount().emailStatus).toBe('status.auth.verified');
expect(instance.getAccount().keepLoggedIn).toBeTrue();

Let's add a check for the keepLoggedIn behavior since that's what this particular ticket is all about. These tests otherwise just check for email/phone verification, and so pass even when copied over to the main branch. I'd like to see these tests fail if we run them if the specific bug addressed in this ticket isn't fixed, if that makes sense.

instance.setAccount(account);

await instance.verifyEmail('sampleToken');
expect(instance.getAccount().phoneStatus).toBe('status.auth.verified');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(instance.getAccount().phoneStatus).toBe('status.auth.verified');
expect(instance.getAccount().phoneStatus).toBe('status.auth.verified');
expect(instance.getAccount().keepLoggedIn).toBeTrue();

Added 2 tests to make sure keepLoggedIn is true.
Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be working now, thanks Andrei!

@crisnicandrei crisnicandrei merged commit 26e75d3 into main Oct 2, 2023
5 checks passed
@crisnicandrei crisnicandrei deleted the PER-9361-email-and-phone-verif branch October 2, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants